<template>
    <div>
        <base-list ref="register" :condition="condition" :datas.sync="OperatingDivisions" :page-search="pageSearch">
            <el-form :inline="true" :model="condition" class="search-form" slot="search" label-width="80px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="作业港口">
                            <select-port v-model="condition['search_EQ_taskPort']" clearable></select-port>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="作业班次">
                            <autoSearchResource searchType='JOB_ZY'
                                                @selectName="v=>condition['search_LIKE_workTeamName']=v"
                                                searchName="resourceName" clearable></autoSearchResource>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="16">
                        <el-form-item label="登录时间">
                            <date-slot :startDate.sync="condition.search_GTE_loginTime"
                                       :endDate.sync="condition.search_LTE_loginTime"></date-slot>
                        </el-form-item>
                        <el-button type="primary" icon="el-icon-search" @click="loadData" class="ml-80">查 询</el-button>
                    </el-col>
                </el-row>
            </el-form>
            <el-table :data="OperatingDivisions" border stripe max-height="500" class="mt-10" slot="list">
                <el-table-column
                    type="index"
                    width="50">
                </el-table-column>
                <el-table-column prop="taskPortName" label="港口"  min-width="100"></el-table-column>
                <el-table-column prop="workTeamName" label="作业班次"  min-width="140"></el-table-column>
                <el-table-column prop="userName" label="作业人"  width="110"></el-table-column>
                <el-table-column prop="workPlace" label="作业地点"  min-width="110"></el-table-column>
                <el-table-column prop="loginTime" label="登录时间"  min-width="110"></el-table-column>
            </el-table>
        </base-list>
    </div>
</template>

<script>
    import {
        LoginInfo,
        OperatingDivisions
    } from "@/api/system/person";
    import dateSlot from '@/components/date/dateSlot';
    import autoSearchResource from '@/components/autocomplete/autoSearchResource';
    import selectPort from '@/components/select/selectPort';
    import {
        getLocalTime
    } from "@/utils/dateFormat";

    export default {
        name: "登录信息查询",
        components: {
            dateSlot,
            autoSearchResource,
            selectPort
        },
        data() {
            return {
                condition: {
                    search_GTE_loginTime: getLocalTime(new Date(), 'YYYY-MM-DD'),
                    search_LTE_loginTime: getLocalTime(new Date(), 'YYYY-MM-DD'),
                    search_EQ_taskPort: '',
                    search_LIKE_workTeamName: ''
                },
                OperatingDivisions: [],
                pageSearch: LoginInfo,
                key: ''
            }
        },
        mounted() {
            this.loadData();
        },
        methods: {
            loadData() {
                this.$refs.register.loadData();
            }
        },
    }
</script>

<style scoped>

</style>
